<?php
require_once realpath(dirname(__FILE__).'/../../app/init.php');
require_once 'AIR2_DBManager.php';
$profile_name = AIR2_DBManager::init();

/**
 * Uses doctrine to load data fixtures into the database. Helps to create
 * some of the default table data needed for AIR2
 */

$conn = AIR2_DBManager::get_master_connection();

try {
    $conn->execute('SET FOREIGN_KEY_CHECKS = 0');

    echo " > loading base fixtures .... ";
    Doctrine::loadData(APPPATH.'/fixtures/base');
    echo "Done!\n";

    $conn->execute('SET FOREIGN_KEY_CHECKS = 1');
} catch (Doctrine_Exception $e) {
    error_log("Error loading fixture files!");
    error_log($e->getMessage());
}

?>
